package com.wu;

import com.wu.entity.User;
import com.wu.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wuyanshen
 * @date 2019-01-21 11:29 AM
 * @discription 描述
 */
public class test {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");

        User user = (User) context.getBean("user");

//        user.setId(1);
//        user.setName("小米");

//        System.out.println(user);


        UserService userService = (UserService) context.getBean("userService");
        user = userService.getUser(user);

        System.out.println(user);
    }
}
